{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 抓取雪球文章\n",
    "\n",
    "- 作者：DGC'Idea\n",
    "- 版本：V0.1   \n",
    "- 更新日期：2018年4月14日\n",
    "\n",
    "----------\n",
    "\n",
    "- 研究目的：获取微信公众号文章；"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": "数据引擎：运行于研究\n 已准备好！\n"
    }
   ],
   "source": [
    "#引入包\n",
    "import pandas as pd\n",
    "import requests,re,json,time,os\n",
    "\n",
    "\n",
    "# 自定义\n",
    "import sys\n",
    "sys.path.append('../DM')\n",
    "sys.path.append('../TL')\n",
    "\n",
    "from dm import *\n",
    "from tl import exists_file\n",
    "\n",
    "# 数据目录\n",
    "_data_path='../Data/'\n",
    "# 数据引擎\n",
    "_data=Csv(_data_path)\n",
    "\n",
    "\n",
    "\n",
    "#\n",
    "base_url='https://xueqiu.com'\n",
    "\n",
    "\n",
    "#时间戳转换成日期\n",
    "def timestamp_date(timestamp):\n",
    "    return time.strftime('%Y-%m-%d %H:%M',time.localtime(int(str(timestamp)[0:10])))\n",
    "\n",
    "\n",
    "#检测文件      \n",
    "def exists_xueqiu_file(user_id,data_root=_data_path):\n",
    "    #cvs文件名\n",
    "    data_file='%s%s.csv'%(data_root,'msg_xqwz_'+user_id)\n",
    "    return exists_file(data_file)\n",
    "\n",
    "\n",
    "#读取数据        \n",
    "def read_xueqiu_data(user_id):\n",
    "    #文件名\n",
    "    data_file='msg_xqwz_'+user_id\n",
    "    #从cvs文件恢复数据\n",
    "    df=_data.read(data_file)\n",
    "    return df\n",
    "\n",
    "\n",
    "#保存数据        \n",
    "def save_xueqiu_data(user_id,df):\n",
    "    #文件名\n",
    "    data_file='msg_xqwz_'+user_id\n",
    "    #保存到cvs文件\n",
    "    _data.save(data_file,df,append=False)\n",
    "\n",
    "\n",
    "\n",
    "#headers\n",
    "header={\n",
    "    \"HOST\":'xueqiu.com',\n",
    "    'User-Agent':'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.104 \\\n",
    "Safari/537.36 Core/1.53.4620.400 QQBrowser/9.7.13014.400'\n",
    "    }\n",
    "\n",
    "# cookies\n",
    "def get_xueqiu_cookies():\n",
    "    cookies_str='aliyungf_tc=AQAAAKzMsS1s2Q4AUHWuPB933Kpmjm0e; device_id=1122282b8c299527c7cb6d188fa28a44; remember=1; remember.sig=K4F3faYzmVuqC0iXIERCQf55g2Y; xq_a_token=5654fd39cb89fef36765cc9038bc5b47ad0e62ba; xq_a_token.sig=MZOhC2VaLNqrwpqJk0ONVR8kUMY; xq_r_token=01ee39b512f28c6f395e2d5fc1eeed662ade6a39; xq_r_token.sig=U3jfCcO3T4tjqSenYk1Oevgpufg; xq_is_login=1; xq_is_login.sig=J3LxgPVPUzbBg3Kee_PquUfih7Q; u=6582724674; u.sig=1g3gy3Thq5MyFexbtGy2oMIfDW0; s=ep12uiderf; bid=14636255fdee238fdda1fc0fe35fbb46_jg2y7pzt; snbim_minify=true; __utmt=1; Hm_lvt_1db88642e346389874251b5a1eded6e3=1523925825,1523925860,1523930936; Hm_lpvt_1db88642e346389874251b5a1eded6e3=1523931199; __utma=1.1796576587.1523925827.1523925827.1523930937.2; __utmb=1.6.10.1523930937; __utmc=1; __utmz=1.1523930937.2.2.utmcsr=sogou.com|utmccn=(referral)|utmcmd=referral|utmcct=/link'\n",
    "    #cookies_str转换为字典格式\n",
    "    cookies_str=cookies_str.split('; ')\n",
    "    cookies={}\n",
    "    for item in cookies_str:\n",
    "        temp=item.split('=')\n",
    "        cookies[temp[0]]=temp[1]  \n",
    "    return cookies\n",
    "\n",
    "#爬取微信公众号文章\n",
    "#user_id：用户识别码\n",
    "#cookies_str：登陆后的cookies字符串，每次登陆后都不一样，所以要手动获取\n",
    "#start：更新的起始位置，用以实现断点续爬和增量更新\n",
    "def get_xueqiu_link(user_id,start=0):\n",
    "    #cookies_str转换为字典格式\n",
    "    cookies=get_xueqiu_cookies()  \n",
    "    #数据列表\n",
    "    data_list=[]\n",
    "    #当前页\n",
    "    page=1\n",
    "    #页面数\n",
    "    pages=1\n",
    "    #计数器\n",
    "    count=1\n",
    "    #捕获错误\n",
    "    try:\n",
    "        while page<=pages:\n",
    "            url='https://xueqiu.com/statuses/original/timeline.json?user_id=%s&page=%s'%(user_id,page)\n",
    "            #获取每一页文章的标题和链接地址\n",
    "            r=requests.get(url,cookies=cookies,headers=header)\n",
    "            column=r.json()\n",
    "            #获得当前页文章列表\n",
    "            item_list=column.get('list')\n",
    "            #如果无数据跳出循环\n",
    "            if len(item_list)==0:\n",
    "                break\n",
    "            #如果是首页，获取总页数、总数量、每页数量    \n",
    "            if page==1:\n",
    "                #总数量\n",
    "                total=int(column.get('total'))  \n",
    "                #如果总数量和起始数相等，则退出\n",
    "                if total==start:\n",
    "                    break\n",
    "                #每页数量    \n",
    "                item_count=int(column.get('count')) \n",
    "                #总页数\n",
    "                max_page=int(column.get('maxPage')) \n",
    "                #计算实际页数\n",
    "                pages=int((total-start)/item_count)\n",
    "                #不足1页，算1页\n",
    "                if total%item_count!=0 or pages==0 :\n",
    "                    pages+=1\n",
    "            #如果是最后一页，只取零头数量    \n",
    "            if page==pages:    \n",
    "                item_list=item_list[0:(total-start)%item_count-1]  \n",
    "            #遍历当前页文章列表\n",
    "            for item in item_list:\n",
    "                #文章链接、标题、时间戳（时间戳转换为日期）\n",
    "                data_list.append([timestamp_date(item.get('created_at')),item.get('title'),base_url+item.get('target'),'*',False])\n",
    "                print(' 本次已获取：%s 篇，共 %s 篇'%(count,total),end='\\r')\n",
    "                #计数\n",
    "                count+=1\n",
    "            #页面数递减    \n",
    "            page+=1\n",
    "            #延时，防止被踢\n",
    "            #time.sleep(1)\n",
    "    #打印错误，并忽略        \n",
    "    except Exception as e:\n",
    "        print('错误：%s'%(e))\n",
    "        pass\n",
    "    #没取到数据    \n",
    "    if len(data_list)==0:\n",
    "        return None\n",
    "    else:\n",
    "        #整理数据    \n",
    "        df=pd.DataFrame(data_list,columns=['date','title','link','content','sended'])    \n",
    "        #返回数据\n",
    "        return df\n",
    "    \n",
    "    \n",
    "xueqiu_list=[\n",
    "    {\n",
    "    'user_id':'4776750571',  \n",
    "    'user_name':'ETF拯救世界',    \n",
    "    },\n",
    "    {\n",
    "    'user_id':'5941996397',  \n",
    "    'user_name':'股市药丸',    \n",
    "    },\n",
    "]        \n",
    "\n",
    "print(' 已准备好！')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1.设置当前公众号"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": "ID    4776750571\n 名称  ETF拯救世界\n"
    }
   ],
   "source": [
    "user_id=xueqiu_list[0]['user_id'] \n",
    "user_name=xueqiu_list[0]['user_name'] \n",
    "print(' ID   ',user_id)\n",
    "print(' 名称 ',user_name)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.获取文章链接"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": "错误：HTTPSConnectionPool(host='xueqiu.com', port=443): Max retries exceeded with url: /statuses/original/timeline.json?user_id=4776750571&page=1 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x00000167B8C4BA48>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))\n获取不成功！\n"
    }
   ],
   "source": [
    "# 断点续爬数据\n",
    "def update_xueqiu_data(user_id):\n",
    "    #检查是否已存在数据\n",
    "    if exists_xueqiu_file(user_id):\n",
    "        #已存在数据\n",
    "        df=read_xueqiu_data(user_id)\n",
    "        #起始位置为当前记录数\n",
    "        new_df=get_xueqiu_link(user_id,len(df)) \n",
    "        if new_df is None:\n",
    "            print('没有新文章或更新不成功！')\n",
    "        else:\n",
    "            #拼接新旧数据\n",
    "            df=pd.concat([new_df,df],ignore_index=True)\n",
    "            #保存到cvs文件\n",
    "            save_xueqiu_data(user_id,df)\n",
    "            print(' 共更新：%s 篇文章！'%len(new_df))    \n",
    "    else:\n",
    "        #数据不存在，起始位置为0 \n",
    "        df=get_xueqiu_link(user_id,0)  \n",
    "        if df is None:\n",
    "            print('获取不成功！')\n",
    "        else:\n",
    "            #保存到cvs文件\n",
    "            save_xueqiu_data(user_id,df)\n",
    "            print(' 共获取：%s 篇文章！'%len(df))\n",
    "    \n",
    "update_xueqiu_data(user_id)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 3.获取文章内容"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " 文章内容获取完毕！-04-20 20:22 为什么90%的人会死在市场里\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/opt/conda/lib/python3.4/site-packages/pandas/core/indexing.py:115: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
      "  self._setitem_with_indexer(indexer, value)\n"
     ]
    }
   ],
   "source": [
    "# 获取文章内容\n",
    "def get_xueqiu_content(user_id):\n",
    "    #已获取标记\n",
    "    isget=False\n",
    "    #判断是否已存在文件\n",
    "    if exists_xueqiu_file(user_id): \n",
    "        #读取数据\n",
    "        df=read_xueqiu_data(user_id)  \n",
    "        #遍历数据表\n",
    "        for i in range(len(df)):\n",
    "            #判断是否已获取\n",
    "            if df.content.iloc[i]=='*' :\n",
    "                print(' 正在获取：%s %s'%(df.date.iloc[i],df.title.iloc[i]),end='\\r')\n",
    "                #文章url\n",
    "                url=df.link.iloc[i]\n",
    "                #请求数据\n",
    "                r=requests.get(url,headers=header)\n",
    "                r=r.text\n",
    "                #解析网页\n",
    "                content=r.split('\"text\":')[1].split('\",')[0] \n",
    "                #添加数据\n",
    "                df.content.iloc[i]=content\n",
    "                isget=True\n",
    "                #延时5秒，防止被踢\n",
    "                time.sleep(1)\n",
    "    #如果获取到文章            \n",
    "    if isget==True:  \n",
    "        #保存数据表\n",
    "        save_xueqiu_data(user_id,df) \n",
    "        print(' 文章内容获取完毕！')\n",
    "    else:\n",
    "        print(' 尚未获取文章列表或是没有要获取的！')\n",
    "        \n",
    "get_xueqiu_content(user_id)        "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 4.发送邮件"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " 发送完毕！\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/opt/conda/lib/python3.4/site-packages/pandas/core/indexing.py:115: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
      "  self._setitem_with_indexer(indexer, value)\n"
     ]
    }
   ],
   "source": [
    "import os\n",
    "\n",
    "#引入自定义（jsl）库\n",
    "#保存当前目录\n",
    "path=os.getcwd()\n",
    "#更改到用户根目录为\n",
    "os.chdir(\"/home/jquser/\")\n",
    "#导入自己的库\n",
    "from mail import *\n",
    "#恢复当前目录\n",
    "os.chdir(path)\n",
    "\n",
    "#发送邮件\n",
    "def send_xueqiu_data(user_id,user_name):\n",
    "    issend=False\n",
    "    if exists_xueqiu_file(user_id):\n",
    "        #读取数据\n",
    "        df=read_xueqiu_data(user_id)\n",
    "        i=len(df)-1\n",
    "        while i>=0:  \n",
    "            if df['sended'].iloc[i]==False:\n",
    "                #邮件主题\n",
    "                subjiect='%s（雪球文章 %s）'%(df.title.iloc[i],user_name)\n",
    "                #邮件正文\n",
    "                message='<h2>%s</h2><p>%s</br>%s</p></br><hr />%s'%(\n",
    "                    df.title.iloc[i],df.date.iloc[i],df.link.iloc[i],df.content.iloc[i])\n",
    "                try:\n",
    "                    #发送邮件\n",
    "                    send_html_qqmail(subjiect,message)\n",
    "                    #发送成功后标记\n",
    "                    df['sended'].iloc[i]=True\n",
    "                    issend=True\n",
    "                    #进度\n",
    "                    print(' 已发送：%s'%(subjiect),end='\\r')\n",
    "                    #延时5秒，防止被踢\n",
    "                    time.sleep(5)\n",
    "                except Exception as e:\n",
    "                    print(' 错误：%s'%e)\n",
    "                    break\n",
    "            i-=1    \n",
    "    if issend==True:    \n",
    "        save_xueqiu_data(user_id,df) \n",
    "        print(' 发送完毕！')\n",
    "    else:\n",
    "        print(' 尚未获取文章列表或是没有要发送的！')\n",
    "    \n",
    "send_xueqiu_data(user_id,user_name)     "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 5.查看数据表"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>date</th>\n",
       "      <th>title</th>\n",
       "      <th>link</th>\n",
       "      <th>content</th>\n",
       "      <th>sended</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2018-02-09 09:13</td>\n",
       "      <td>反鸡汤随笔</td>\n",
       "      <td>https://xueqiu.com/4776750571/101334892</td>\n",
       "      <td>\"&lt;p&gt;&lt;b&gt;不要鸡汤&lt;/b&gt;&lt;/p&gt;&lt;p&gt;最近从美股到港股，从大蓝筹到中小创，你方蹲完我来...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2017-11-29 17:09</td>\n",
       "      <td>情绪和资金</td>\n",
       "      <td>https://xueqiu.com/4776750571/96580085</td>\n",
       "      <td>\"&lt;p&gt;刚才那位朋友提到的市场情绪，曾经在投资笔记中写过一些，贴出来大家共同研究吧。&lt;/p&gt;...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2017-02-07 13:37</td>\n",
       "      <td>珍惜</td>\n",
       "      <td>https://xueqiu.com/4776750571/80856822</td>\n",
       "      <td>\"&lt;p&gt;美国市场早就已经过了从“散户”——“机构”为主导的阶段。&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2017-01-22 13:05</td>\n",
       "      <td>在A股赔钱其实是很奇怪的一件事</td>\n",
       "      <td>https://xueqiu.com/4776750571/80478679</td>\n",
       "      <td>\"&lt;p&gt;从1993年至今，就用很垃圾的上证和深成指数来说，只要长期持有超过10年，任何一年年...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2016-12-27 11:35</td>\n",
       "      <td>2016，继续感恩</td>\n",
       "      <td>https://xueqiu.com/4776750571/79438068</td>\n",
       "      <td>\"&lt;p&gt;是不是要写这份总结，一直没有确认。两个问题：一个是总结这个东西，终究是要写给自己，还...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>2016-01-21 08:31</td>\n",
       "      <td>最大的利好和利空</td>\n",
       "      <td>https://xueqiu.com/4776750571/63930554</td>\n",
       "      <td>\"对投资来说，最大的利好就是便宜，最大的利空就是贵。&lt;br&gt;&lt;br&gt;所以，不要在某个品种很便...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>2016-01-19 09:31</td>\n",
       "      <td>没有股神，只有长跑赢家</td>\n",
       "      <td>https://xueqiu.com/4776750571/63805996</td>\n",
       "      <td>\"投资这件事，很多人希望找到一个股神，幻想只要跟着他投资，就能无往不利，从此日进斗金资产顺利...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>2015-12-24 15:12</td>\n",
       "      <td>感恩，2015</td>\n",
       "      <td>https://xueqiu.com/4776750571/62402064</td>\n",
       "      <td>\"2015年终于要过去了。&lt;br&gt;&lt;br&gt;想在雪球写个投资总结，算是对自己一年的投资经历做个...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>2015-12-14 10:39</td>\n",
       "      <td>证券市场里的两种人</td>\n",
       "      <td>https://xueqiu.com/4776750571/61688888</td>\n",
       "      <td>\"我把证券市场里的人，按照风格分为两种：激进的和保守的。&lt;br&gt;&lt;br&gt;&lt;br&gt;激进的人里面...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>2015-11-27 17:11</td>\n",
       "      <td>下阶段布局的重点</td>\n",
       "      <td>https://xueqiu.com/4776750571/60729568</td>\n",
       "      <td>\"该提示的风险最近这段时间天天说说了有几十篇，现在说也没有任何意义了。看到的朋友算是有缘吧。...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>2015-11-24 10:41</td>\n",
       "      <td>投资的节奏</td>\n",
       "      <td>https://xueqiu.com/4776750571/60430196</td>\n",
       "      <td>\"投资这件事，跟说话、写东西、跳舞、踢球……其实是一样的。想要做的好，都要讲一个节奏。&lt;br...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>2015-11-08 22:54</td>\n",
       "      <td>更加谨慎</td>\n",
       "      <td>https://xueqiu.com/4776750571/59316681</td>\n",
       "      <td>\"从本质上说，本人是个低风险爱好者。想让本人重仓，真的要比较便宜才行。&lt;br&gt;&lt;br&gt;另一方...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>2015-11-07 09:21</td>\n",
       "      <td>沙盘推演IPO重启的影响</td>\n",
       "      <td>https://xueqiu.com/4776750571/59251012</td>\n",
       "      <td>\"一晚上过去，大家情绪都平复点了吧。咱们一起推演一下IPO新政实施后会发生的事情：&lt;br&gt;&lt;...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>2015-11-05 08:03</td>\n",
       "      <td>你是美羊羊还是灰太狼</td>\n",
       "      <td>https://xueqiu.com/4776750571/59081724</td>\n",
       "      <td>\"&lt;strong&gt;壹，一根阳线改三观&lt;/strong&gt;&lt;br&gt;&lt;br&gt;昨日大涨，几位朋友来信...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>2015-11-03 14:19</td>\n",
       "      <td>从战争的角度思考指数投资</td>\n",
       "      <td>https://xueqiu.com/4776750571/58965236</td>\n",
       "      <td>\"如果我们把投资当做一场战争，那么就可以用以下思路来从大的格局来进行思考。&lt;br&gt;&lt;br&gt;首...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>2015-10-29 11:08</td>\n",
       "      <td>再来一个数据，真的蛮拼的……</td>\n",
       "      <td>https://xueqiu.com/4776750571/58691115</td>\n",
       "      <td>\"代码简称相同股东/持有人持有数占流通A股比例&lt;br/&gt;601969海南矿业中国证券金融股份...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>2015-10-29 09:26</td>\n",
       "      <td>小人求全，君子求缺</td>\n",
       "      <td>https://xueqiu.com/4776750571/58679967</td>\n",
       "      <td>\"有些事情，注定了是完全没有意义的争论。&lt;br&gt;&lt;br&gt;谁也不会说服谁，因为每个人是不同的，...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>2015-10-23 09:31</td>\n",
       "      <td>从中证500的历史收益率看“低买”的重要性</td>\n",
       "      <td>https://xueqiu.com/4776750571/58291428</td>\n",
       "      <td>\"昨天，简单算了一下过去十年中证500的年化到了23%，这个真是震撼。然而，要知道2005年...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>2015-10-21 11:07</td>\n",
       "      <td>全球股票市场历史估值与回报率分析</td>\n",
       "      <td>https://xueqiu.com/4776750571/58143321</td>\n",
       "      <td>\"看估值投资到底有没有用？也许，真的还有那么点卵用。&lt;br&gt;便宜买就是容易赚钱，买贵了10年...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>2015-10-20 13:30</td>\n",
       "      <td>再看养老指数</td>\n",
       "      <td>https://xueqiu.com/4776750571/58075711</td>\n",
       "      <td>\"证券代码证券简称市盈率PE(TTM)&lt;br&gt; &amp;nbsp; &amp;nbsp; &lt;br&gt; &amp;nb...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>2015-10-19 10:06</td>\n",
       "      <td>这是个好指数</td>\n",
       "      <td>https://xueqiu.com/4776750571/57986039</td>\n",
       "      <td>\"成分券代码&lt;br&gt; &amp;nbsp; &amp;nbsp; Constituent Code成分券名称...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>2015-10-11 08:05</td>\n",
       "      <td>另一个角度看估值</td>\n",
       "      <td>https://xueqiu.com/4776750571/57458354</td>\n",
       "      <td>\"刚才看到尊敬的&lt;a href=\\\"http://xueqiu.com/n/宁静的冬日M\\\"...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>2015-10-09 12:28</td>\n",
       "      <td>低买高卖，好策略才是真王道</td>\n",
       "      <td>https://xueqiu.com/4776750571/57394021</td>\n",
       "      <td>\"投资这个东西，赚钱说起来真的不难，甚至可以说很简单。当然，我说的是年化预期收益率比较合理的...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>2015-09-29 11:28</td>\n",
       "      <td>2015年5、6月，聪明钱在干什么？</td>\n",
       "      <td>https://xueqiu.com/4776750571/57121454</td>\n",
       "      <td>\"大概从10年前起，就开始有意识的收集市场极端情况下的新闻报道。&lt;br&gt;&lt;br&gt;真的特别有意...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>2015-09-24 11:27</td>\n",
       "      <td>ETF拯救世界的干货合集</td>\n",
       "      <td>https://xueqiu.com/4776750571/56918002</td>\n",
       "      <td>\"（“ETF拯救世界”这个ID的含义，是：指数投资能够拯救绝大多数股海沉浮而终不能赚钱的人们...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>2015-09-23 10:15</td>\n",
       "      <td>技术还是价值并不重要，重要的是纪律和耐心</td>\n",
       "      <td>https://xueqiu.com/4776750571/56842488</td>\n",
       "      <td>\"来雪球好几年，昨天第一次发了个技术贴，万万没想到居然有一百多评论——只是因为好玩才发的。&lt;...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>2015-09-22 11:05</td>\n",
       "      <td>干货：如何从相关性的角度选指数</td>\n",
       "      <td>https://xueqiu.com/4776750571/56782264</td>\n",
       "      <td>\"好久没上干货了，每次发条段子，一刷新，关注的朋友啪啪的减少。&lt;br&gt;&lt;br&gt;感觉不会再爱了...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>2015-09-17 11:52</td>\n",
       "      <td>时点配置</td>\n",
       "      <td>https://xueqiu.com/4776750571/56551915</td>\n",
       "      <td>\"大类资产最大分配时点比例应配比例&lt;br&gt;债券现金85.00%80.00%68.00%&lt;br...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>2015-09-15 16:29</td>\n",
       "      <td>暗黑之夜下半场已然开启，但光明就在那里，不远不近</td>\n",
       "      <td>https://xueqiu.com/4776750571/56436606</td>\n",
       "      <td>\"首先，我们回顾一下A股市场的大底和大顶是长什么样子：&lt;br&gt;&lt;br&gt;2012年11月大底：...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>2015-09-13 11:10</td>\n",
       "      <td>十年收益：低估值、中等估值、高估值投资的结果</td>\n",
       "      <td>https://xueqiu.com/4776750571/56310631</td>\n",
       "      <td>\"数据来源：天天基金网&lt;br&gt;统计范围：所有公募基金&lt;br&gt;&lt;br&gt;&lt;strong&gt;2005...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>2015-08-27 13:55</td>\n",
       "      <td>对比股票，投资ETF的好处是什么？</td>\n",
       "      <td>https://xueqiu.com/4776750571/55453737</td>\n",
       "      <td>\"感谢&lt;a href=\\\"http://xueqiu.com/n/焱阳高照\\\" target...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>2015-08-25 09:12</td>\n",
       "      <td>不得不写的文章：批发干货与鸡汤</td>\n",
       "      <td>https://xueqiu.com/4776750571/55241308</td>\n",
       "      <td>\"&lt;strong&gt;【干货篇】&lt;/strong&gt;&lt;br&gt;&lt;br&gt;昨天市场继续暴跌，很多朋友在评...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>2015-08-18 09:10</td>\n",
       "      <td>天天找主力，其实你就是主力好吗</td>\n",
       "      <td>https://xueqiu.com/4776750571/54718695</td>\n",
       "      <td>\"这几天鸡汤和段子多了点，上个准干货给大家盘前开开胃，顺便欢迎第【20250】位关注我的朋友...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>2015-08-16 08:29</td>\n",
       "      <td>有价值的东西总是不引人注意&amp;我们就是没耐心</td>\n",
       "      <td>https://xueqiu.com/4776750571/54543524</td>\n",
       "      <td>\"其实有些感慨，也觉得挺有意思。&lt;br&gt;&lt;br&gt;2012年11月28日，在雪球写了第一篇文章...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>2015-08-13 11:36</td>\n",
       "      <td>保持开放的态度</td>\n",
       "      <td>https://xueqiu.com/4776750571/54311980</td>\n",
       "      <td>\"既然股票有上涨和下跌两种走势，那么对股票的看法自然有看涨和看跌。否则一笔买卖无法成交。&lt;b...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>2015-08-11 09:09</td>\n",
       "      <td>哈迪斯之顶</td>\n",
       "      <td>https://xueqiu.com/4776750571/54058272</td>\n",
       "      <td>\"如今我走到了人生的十字路口，我知道哪条路是对的，毫无疑问，我知道 ，但我从不走，为什么？因...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>2015-08-06 22:27</td>\n",
       "      <td>投资：独立思维很重要</td>\n",
       "      <td>https://xueqiu.com/4776750571/53752657</td>\n",
       "      <td>\"在雪球浏览的时间越多，越感觉国人似乎普遍缺失一种很珍贵的素质——独立思维。&lt;br&gt;&lt;br&gt;...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>2015-08-05 10:44</td>\n",
       "      <td>市场当然是有效的</td>\n",
       "      <td>https://xueqiu.com/4776750571/53595185</td>\n",
       "      <td>\"接着刚才说的，有效市场理论这个话题，结合这几年中国股市的走势多说那么两三句。&lt;br&gt;&lt;br...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41</th>\n",
       "      <td>2015-08-03 12:09</td>\n",
       "      <td>让我心静如水的一张表格</td>\n",
       "      <td>https://xueqiu.com/4776750571/53404688</td>\n",
       "      <td>\"很多人被一本书或一个人深深影响，改变了人生轨迹。&lt;br/&gt;&lt;br/&gt;而我想说，每次到了股市...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>42</th>\n",
       "      <td>2015-07-27 13:11</td>\n",
       "      <td>指数投资并不只是上证或者沪深300，而是更广阔的世界</td>\n",
       "      <td>https://xueqiu.com/4776750571/52750793</td>\n",
       "      <td>\"中午看了评论，才发现有朋友对指数投资误解颇深：07年到过6000点，现在才4000的一个东...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>43</th>\n",
       "      <td>2015-07-21 09:17</td>\n",
       "      <td>关于黄金投资</td>\n",
       "      <td>https://xueqiu.com/4776750571/52026846</td>\n",
       "      <td>\"很多朋友留言和私信询问黄金etf的问题。在这里统一做个答复：&lt;br&gt;&lt;br&gt;黄金从来都是本...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>44</th>\n",
       "      <td>2015-07-16 08:55</td>\n",
       "      <td>看图算命</td>\n",
       "      <td>https://xueqiu.com/4776750571/51490786</td>\n",
       "      <td>\"我不懂什么波浪理论，也不懂什么技术指标，但是从pe、pb估值图看，说一个很多朋友会不愿意接...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>45</th>\n",
       "      <td>2015-07-10 09:17</td>\n",
       "      <td>分级战役进入完美收官阶段，着手准备下一场硬仗</td>\n",
       "      <td>https://xueqiu.com/4776750571/50879433</td>\n",
       "      <td>\"6月份，提出的三大战役中，第一阶段“辽沈”已经接近收官。分级A不仅在大崩盘的局面下保住了本...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46</th>\n",
       "      <td>2015-07-07 15:53</td>\n",
       "      <td>20年，估值图上从未见过如此一幕。</td>\n",
       "      <td>https://xueqiu.com/4776750571/50509529</td>\n",
       "      <td>\"&lt;img class=\\\"ke_img\\\" src=\\\"https://xqimg.ime...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>47</th>\n",
       "      <td>2015-07-07 09:34</td>\n",
       "      <td>重组A——第三口肉吃到</td>\n",
       "      <td>https://xueqiu.com/4776750571/50445941</td>\n",
       "      <td>\"第三口肉顺利吃到。&lt;br&gt;&lt;br&gt;重组a顺利下折。&lt;br&gt;&lt;br&gt;本人重仓的前三大分级A全...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>48</th>\n",
       "      <td>2015-07-06 16:25</td>\n",
       "      <td>统一回复一些分级A的问题，请各位网友周知</td>\n",
       "      <td>https://xueqiu.com/4776750571/50378491</td>\n",
       "      <td>\"最近分级A类涨的好，很多朋友在评论，私信里问我某只该不该买，某只该不该卖，某只是否该持有到...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49</th>\n",
       "      <td>2015-07-02 17:17</td>\n",
       "      <td>看图说话，明天能买了吗？（经网友提醒增加行业）</td>\n",
       "      <td>https://xueqiu.com/4776750571/50010394</td>\n",
       "      <td>\"先看图，再说话&lt;br&gt;&lt;br&gt;&lt;img class=\\\"ke_img\\\" src=\\\"ht...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50</th>\n",
       "      <td>2015-06-28 06:47</td>\n",
       "      <td>凑热闹说两句双降对A类的影响以及后期策略</td>\n",
       "      <td>https://xueqiu.com/4776750571/49484772</td>\n",
       "      <td>\"任何投资，都不应该忘记初心。到底当初是为了什么购买这个品种，永远也不能忘，直到卖出它的那一...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>51</th>\n",
       "      <td>2015-06-26 16:51</td>\n",
       "      <td>本周全市场PE数据解读+成功投资必备的四个素质</td>\n",
       "      <td>https://xueqiu.com/4776750571/49398967</td>\n",
       "      <td>\"不好意思，今天部门招人，上下午都在面试，晚了，大家海涵。&lt;br&gt;&lt;br&gt;&lt;br&gt;先说两句前...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>52</th>\n",
       "      <td>2015-06-25 15:24</td>\n",
       "      <td>噪音太多</td>\n",
       "      <td>https://xueqiu.com/4776750571/49267835</td>\n",
       "      <td>\"以前社交网络不发达，有很多事不明白为什么。&lt;br&gt;&lt;br&gt;拿上个牛市，07年说吧。&lt;br&gt;...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>53</th>\n",
       "      <td>2015-06-19 10:31</td>\n",
       "      <td>再说散户的投资原则</td>\n",
       "      <td>https://xueqiu.com/4776750571/48752706</td>\n",
       "      <td>\"散户，你过来，咱们聊聊你应有的投资原则。&lt;br&gt;&lt;br&gt;没错，别看别人，说的就是你！&lt;br...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54</th>\n",
       "      <td>2015-06-15 17:18</td>\n",
       "      <td>投资分级A：宁拿25%收益哭，也不在万点牛市笑</td>\n",
       "      <td>https://xueqiu.com/4776750571/48268747</td>\n",
       "      <td>\"伟大的中国股市正在将牛市继续向前疯狂推进。以上周五收盘价计算，我们计算的沪深两市全部股票（...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>55</th>\n",
       "      <td>2015-06-09 15:55</td>\n",
       "      <td>中证TMT成分股TTM PE一览</td>\n",
       "      <td>https://xueqiu.com/4776750571/47464103</td>\n",
       "      <td>\"我承认，下面这一百只股票里面，可能有5只或者10只会成为伟大企业。但你100多只都这个估值...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>56</th>\n",
       "      <td>2015-06-03 12:20</td>\n",
       "      <td>我们正在创造历史——图解201506估值</td>\n",
       "      <td>https://xueqiu.com/4776750571/46597942</td>\n",
       "      <td>\"写在前面：&lt;br&gt;&lt;br&gt;先说几句废话吧，毕竟有些东西一定有人问，评论里一一回复不现实。不...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>57</th>\n",
       "      <td>2015-04-02 13:29</td>\n",
       "      <td>A股是个聚宝盆</td>\n",
       "      <td>https://xueqiu.com/4776750571/39611266</td>\n",
       "      <td>\"最近，A股是不是一个“吃人不吐骨头”的市场似乎在雪球引起了不小的争议。在这个市场上，只有1...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>58</th>\n",
       "      <td>2015-03-31 16:29</td>\n",
       "      <td>大风起兮猪飞扬</td>\n",
       "      <td>https://xueqiu.com/4776750571/39421175</td>\n",
       "      <td>\"看图说话：&lt;br/&gt;&lt;br/&gt;1、全市场pe与深综指对比图：全市场pe已经越过2010年高...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>59</th>\n",
       "      <td>2015-01-02 21:43</td>\n",
       "      <td>2015：ETF投资计划的过去、现在和未来</td>\n",
       "      <td>https://xueqiu.com/4776750571/34758228</td>\n",
       "      <td>\"闲话不多说，进入正题：&lt;br&gt;&lt;br&gt;&lt;strong&gt;壹：现在的市场估值&lt;br&gt;&lt;br&gt;&lt;...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>60</th>\n",
       "      <td>2014-03-23 21:45</td>\n",
       "      <td>再说etf资产配置</td>\n",
       "      <td>https://xueqiu.com/4776750571/28380907</td>\n",
       "      <td>\"从大的方面来讲，资产配置的重点，就是把资产合理配置到相关系数很低的各项资产中。相关系数低，...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>61</th>\n",
       "      <td>2013-07-15 09:53</td>\n",
       "      <td>2000点说仓位</td>\n",
       "      <td>https://xueqiu.com/4776750571/24426764</td>\n",
       "      <td>\"本杰明格雷厄姆在上世纪60年代出版的，针对业余投资者的圣经（针对专业投资者的圣经则是《证券...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>62</th>\n",
       "      <td>2012-11-28 11:09</td>\n",
       "      <td>标题</td>\n",
       "      <td>https://xueqiu.com/4776750571/22523458</td>\n",
       "      <td>\"今天，看着不断暴跌的中小板，没有等到15:40 wind上的数据计算结束，我就知道，这是伟...</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>63 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                date                       title  \\\n",
       "0   2018-02-09 09:13                       反鸡汤随笔   \n",
       "1   2017-11-29 17:09                       情绪和资金   \n",
       "2   2017-02-07 13:37                          珍惜   \n",
       "3   2017-01-22 13:05             在A股赔钱其实是很奇怪的一件事   \n",
       "4   2016-12-27 11:35                   2016，继续感恩   \n",
       "5   2016-01-21 08:31                    最大的利好和利空   \n",
       "6   2016-01-19 09:31                 没有股神，只有长跑赢家   \n",
       "7   2015-12-24 15:12                     感恩，2015   \n",
       "8   2015-12-14 10:39                   证券市场里的两种人   \n",
       "9   2015-11-27 17:11                    下阶段布局的重点   \n",
       "10  2015-11-24 10:41                       投资的节奏   \n",
       "11  2015-11-08 22:54                        更加谨慎   \n",
       "12  2015-11-07 09:21                沙盘推演IPO重启的影响   \n",
       "13  2015-11-05 08:03                  你是美羊羊还是灰太狼   \n",
       "14  2015-11-03 14:19                从战争的角度思考指数投资   \n",
       "15  2015-10-29 11:08              再来一个数据，真的蛮拼的……   \n",
       "16  2015-10-29 09:26                   小人求全，君子求缺   \n",
       "17  2015-10-23 09:31       从中证500的历史收益率看“低买”的重要性   \n",
       "18  2015-10-21 11:07            全球股票市场历史估值与回报率分析   \n",
       "19  2015-10-20 13:30                      再看养老指数   \n",
       "20  2015-10-19 10:06                      这是个好指数   \n",
       "21  2015-10-11 08:05                    另一个角度看估值   \n",
       "22  2015-10-09 12:28               低买高卖，好策略才是真王道   \n",
       "23  2015-09-29 11:28          2015年5、6月，聪明钱在干什么？   \n",
       "24  2015-09-24 11:27                ETF拯救世界的干货合集   \n",
       "25  2015-09-23 10:15        技术还是价值并不重要，重要的是纪律和耐心   \n",
       "26  2015-09-22 11:05             干货：如何从相关性的角度选指数   \n",
       "27  2015-09-17 11:52                        时点配置   \n",
       "28  2015-09-15 16:29    暗黑之夜下半场已然开启，但光明就在那里，不远不近   \n",
       "29  2015-09-13 11:10      十年收益：低估值、中等估值、高估值投资的结果   \n",
       "..               ...                         ...   \n",
       "33  2015-08-27 13:55           对比股票，投资ETF的好处是什么？   \n",
       "34  2015-08-25 09:12             不得不写的文章：批发干货与鸡汤   \n",
       "35  2015-08-18 09:10             天天找主力，其实你就是主力好吗   \n",
       "36  2015-08-16 08:29       有价值的东西总是不引人注意&我们就是没耐心   \n",
       "37  2015-08-13 11:36                     保持开放的态度   \n",
       "38  2015-08-11 09:09                       哈迪斯之顶   \n",
       "39  2015-08-06 22:27                  投资：独立思维很重要   \n",
       "40  2015-08-05 10:44                    市场当然是有效的   \n",
       "41  2015-08-03 12:09                 让我心静如水的一张表格   \n",
       "42  2015-07-27 13:11  指数投资并不只是上证或者沪深300，而是更广阔的世界   \n",
       "43  2015-07-21 09:17                      关于黄金投资   \n",
       "44  2015-07-16 08:55                        看图算命   \n",
       "45  2015-07-10 09:17      分级战役进入完美收官阶段，着手准备下一场硬仗   \n",
       "46  2015-07-07 15:53           20年，估值图上从未见过如此一幕。   \n",
       "47  2015-07-07 09:34                 重组A——第三口肉吃到   \n",
       "48  2015-07-06 16:25        统一回复一些分级A的问题，请各位网友周知   \n",
       "49  2015-07-02 17:17     看图说话，明天能买了吗？（经网友提醒增加行业）   \n",
       "50  2015-06-28 06:47        凑热闹说两句双降对A类的影响以及后期策略   \n",
       "51  2015-06-26 16:51     本周全市场PE数据解读+成功投资必备的四个素质   \n",
       "52  2015-06-25 15:24                        噪音太多   \n",
       "53  2015-06-19 10:31                   再说散户的投资原则   \n",
       "54  2015-06-15 17:18     投资分级A：宁拿25%收益哭，也不在万点牛市笑   \n",
       "55  2015-06-09 15:55            中证TMT成分股TTM PE一览   \n",
       "56  2015-06-03 12:20        我们正在创造历史——图解201506估值   \n",
       "57  2015-04-02 13:29                     A股是个聚宝盆   \n",
       "58  2015-03-31 16:29                     大风起兮猪飞扬   \n",
       "59  2015-01-02 21:43       2015：ETF投资计划的过去、现在和未来   \n",
       "60  2014-03-23 21:45                   再说etf资产配置   \n",
       "61  2013-07-15 09:53                    2000点说仓位   \n",
       "62  2012-11-28 11:09                          标题   \n",
       "\n",
       "                                       link  \\\n",
       "0   https://xueqiu.com/4776750571/101334892   \n",
       "1    https://xueqiu.com/4776750571/96580085   \n",
       "2    https://xueqiu.com/4776750571/80856822   \n",
       "3    https://xueqiu.com/4776750571/80478679   \n",
       "4    https://xueqiu.com/4776750571/79438068   \n",
       "5    https://xueqiu.com/4776750571/63930554   \n",
       "6    https://xueqiu.com/4776750571/63805996   \n",
       "7    https://xueqiu.com/4776750571/62402064   \n",
       "8    https://xueqiu.com/4776750571/61688888   \n",
       "9    https://xueqiu.com/4776750571/60729568   \n",
       "10   https://xueqiu.com/4776750571/60430196   \n",
       "11   https://xueqiu.com/4776750571/59316681   \n",
       "12   https://xueqiu.com/4776750571/59251012   \n",
       "13   https://xueqiu.com/4776750571/59081724   \n",
       "14   https://xueqiu.com/4776750571/58965236   \n",
       "15   https://xueqiu.com/4776750571/58691115   \n",
       "16   https://xueqiu.com/4776750571/58679967   \n",
       "17   https://xueqiu.com/4776750571/58291428   \n",
       "18   https://xueqiu.com/4776750571/58143321   \n",
       "19   https://xueqiu.com/4776750571/58075711   \n",
       "20   https://xueqiu.com/4776750571/57986039   \n",
       "21   https://xueqiu.com/4776750571/57458354   \n",
       "22   https://xueqiu.com/4776750571/57394021   \n",
       "23   https://xueqiu.com/4776750571/57121454   \n",
       "24   https://xueqiu.com/4776750571/56918002   \n",
       "25   https://xueqiu.com/4776750571/56842488   \n",
       "26   https://xueqiu.com/4776750571/56782264   \n",
       "27   https://xueqiu.com/4776750571/56551915   \n",
       "28   https://xueqiu.com/4776750571/56436606   \n",
       "29   https://xueqiu.com/4776750571/56310631   \n",
       "..                                      ...   \n",
       "33   https://xueqiu.com/4776750571/55453737   \n",
       "34   https://xueqiu.com/4776750571/55241308   \n",
       "35   https://xueqiu.com/4776750571/54718695   \n",
       "36   https://xueqiu.com/4776750571/54543524   \n",
       "37   https://xueqiu.com/4776750571/54311980   \n",
       "38   https://xueqiu.com/4776750571/54058272   \n",
       "39   https://xueqiu.com/4776750571/53752657   \n",
       "40   https://xueqiu.com/4776750571/53595185   \n",
       "41   https://xueqiu.com/4776750571/53404688   \n",
       "42   https://xueqiu.com/4776750571/52750793   \n",
       "43   https://xueqiu.com/4776750571/52026846   \n",
       "44   https://xueqiu.com/4776750571/51490786   \n",
       "45   https://xueqiu.com/4776750571/50879433   \n",
       "46   https://xueqiu.com/4776750571/50509529   \n",
       "47   https://xueqiu.com/4776750571/50445941   \n",
       "48   https://xueqiu.com/4776750571/50378491   \n",
       "49   https://xueqiu.com/4776750571/50010394   \n",
       "50   https://xueqiu.com/4776750571/49484772   \n",
       "51   https://xueqiu.com/4776750571/49398967   \n",
       "52   https://xueqiu.com/4776750571/49267835   \n",
       "53   https://xueqiu.com/4776750571/48752706   \n",
       "54   https://xueqiu.com/4776750571/48268747   \n",
       "55   https://xueqiu.com/4776750571/47464103   \n",
       "56   https://xueqiu.com/4776750571/46597942   \n",
       "57   https://xueqiu.com/4776750571/39611266   \n",
       "58   https://xueqiu.com/4776750571/39421175   \n",
       "59   https://xueqiu.com/4776750571/34758228   \n",
       "60   https://xueqiu.com/4776750571/28380907   \n",
       "61   https://xueqiu.com/4776750571/24426764   \n",
       "62   https://xueqiu.com/4776750571/22523458   \n",
       "\n",
       "                                              content sended  \n",
       "0   \"<p><b>不要鸡汤</b></p><p>最近从美股到港股，从大蓝筹到中小创，你方蹲完我来...   True  \n",
       "1   \"<p>刚才那位朋友提到的市场情绪，曾经在投资笔记中写过一些，贴出来大家共同研究吧。</p>...   True  \n",
       "2   \"<p>美国市场早就已经过了从“散户”——“机构”为主导的阶段。</p><p><br/></...   True  \n",
       "3   \"<p>从1993年至今，就用很垃圾的上证和深成指数来说，只要长期持有超过10年，任何一年年...   True  \n",
       "4   \"<p>是不是要写这份总结，一直没有确认。两个问题：一个是总结这个东西，终究是要写给自己，还...   True  \n",
       "5   \"对投资来说，最大的利好就是便宜，最大的利空就是贵。<br><br>所以，不要在某个品种很便...   True  \n",
       "6   \"投资这件事，很多人希望找到一个股神，幻想只要跟着他投资，就能无往不利，从此日进斗金资产顺利...   True  \n",
       "7   \"2015年终于要过去了。<br><br>想在雪球写个投资总结，算是对自己一年的投资经历做个...   True  \n",
       "8   \"我把证券市场里的人，按照风格分为两种：激进的和保守的。<br><br><br>激进的人里面...   True  \n",
       "9   \"该提示的风险最近这段时间天天说说了有几十篇，现在说也没有任何意义了。看到的朋友算是有缘吧。...   True  \n",
       "10  \"投资这件事，跟说话、写东西、跳舞、踢球……其实是一样的。想要做的好，都要讲一个节奏。<br...   True  \n",
       "11  \"从本质上说，本人是个低风险爱好者。想让本人重仓，真的要比较便宜才行。<br><br>另一方...   True  \n",
       "12  \"一晚上过去，大家情绪都平复点了吧。咱们一起推演一下IPO新政实施后会发生的事情：<br><...   True  \n",
       "13  \"<strong>壹，一根阳线改三观</strong><br><br>昨日大涨，几位朋友来信...   True  \n",
       "14  \"如果我们把投资当做一场战争，那么就可以用以下思路来从大的格局来进行思考。<br><br>首...   True  \n",
       "15  \"代码简称相同股东/持有人持有数占流通A股比例<br/>601969海南矿业中国证券金融股份...   True  \n",
       "16  \"有些事情，注定了是完全没有意义的争论。<br><br>谁也不会说服谁，因为每个人是不同的，...   True  \n",
       "17  \"昨天，简单算了一下过去十年中证500的年化到了23%，这个真是震撼。然而，要知道2005年...   True  \n",
       "18  \"看估值投资到底有没有用？也许，真的还有那么点卵用。<br>便宜买就是容易赚钱，买贵了10年...   True  \n",
       "19  \"证券代码证券简称市盈率PE(TTM)<br> &nbsp; &nbsp; <br> &nb...   True  \n",
       "20  \"成分券代码<br> &nbsp; &nbsp; Constituent Code成分券名称...   True  \n",
       "21  \"刚才看到尊敬的<a href=\\\"http://xueqiu.com/n/宁静的冬日M\\\"...   True  \n",
       "22  \"投资这个东西，赚钱说起来真的不难，甚至可以说很简单。当然，我说的是年化预期收益率比较合理的...   True  \n",
       "23  \"大概从10年前起，就开始有意识的收集市场极端情况下的新闻报道。<br><br>真的特别有意...   True  \n",
       "24  \"（“ETF拯救世界”这个ID的含义，是：指数投资能够拯救绝大多数股海沉浮而终不能赚钱的人们...   True  \n",
       "25  \"来雪球好几年，昨天第一次发了个技术贴，万万没想到居然有一百多评论——只是因为好玩才发的。<...   True  \n",
       "26  \"好久没上干货了，每次发条段子，一刷新，关注的朋友啪啪的减少。<br><br>感觉不会再爱了...   True  \n",
       "27  \"大类资产最大分配时点比例应配比例<br>债券现金85.00%80.00%68.00%<br...   True  \n",
       "28  \"首先，我们回顾一下A股市场的大底和大顶是长什么样子：<br><br>2012年11月大底：...   True  \n",
       "29  \"数据来源：天天基金网<br>统计范围：所有公募基金<br><br><strong>2005...   True  \n",
       "..                                                ...    ...  \n",
       "33  \"感谢<a href=\\\"http://xueqiu.com/n/焱阳高照\\\" target...   True  \n",
       "34  \"<strong>【干货篇】</strong><br><br>昨天市场继续暴跌，很多朋友在评...   True  \n",
       "35  \"这几天鸡汤和段子多了点，上个准干货给大家盘前开开胃，顺便欢迎第【20250】位关注我的朋友...   True  \n",
       "36  \"其实有些感慨，也觉得挺有意思。<br><br>2012年11月28日，在雪球写了第一篇文章...   True  \n",
       "37  \"既然股票有上涨和下跌两种走势，那么对股票的看法自然有看涨和看跌。否则一笔买卖无法成交。<b...   True  \n",
       "38  \"如今我走到了人生的十字路口，我知道哪条路是对的，毫无疑问，我知道 ，但我从不走，为什么？因...   True  \n",
       "39  \"在雪球浏览的时间越多，越感觉国人似乎普遍缺失一种很珍贵的素质——独立思维。<br><br>...   True  \n",
       "40  \"接着刚才说的，有效市场理论这个话题，结合这几年中国股市的走势多说那么两三句。<br><br...   True  \n",
       "41  \"很多人被一本书或一个人深深影响，改变了人生轨迹。<br/><br/>而我想说，每次到了股市...   True  \n",
       "42  \"中午看了评论，才发现有朋友对指数投资误解颇深：07年到过6000点，现在才4000的一个东...   True  \n",
       "43  \"很多朋友留言和私信询问黄金etf的问题。在这里统一做个答复：<br><br>黄金从来都是本...   True  \n",
       "44  \"我不懂什么波浪理论，也不懂什么技术指标，但是从pe、pb估值图看，说一个很多朋友会不愿意接...   True  \n",
       "45  \"6月份，提出的三大战役中，第一阶段“辽沈”已经接近收官。分级A不仅在大崩盘的局面下保住了本...   True  \n",
       "46  \"<img class=\\\"ke_img\\\" src=\\\"https://xqimg.ime...   True  \n",
       "47  \"第三口肉顺利吃到。<br><br>重组a顺利下折。<br><br>本人重仓的前三大分级A全...   True  \n",
       "48  \"最近分级A类涨的好，很多朋友在评论，私信里问我某只该不该买，某只该不该卖，某只是否该持有到...   True  \n",
       "49  \"先看图，再说话<br><br><img class=\\\"ke_img\\\" src=\\\"ht...   True  \n",
       "50  \"任何投资，都不应该忘记初心。到底当初是为了什么购买这个品种，永远也不能忘，直到卖出它的那一...   True  \n",
       "51  \"不好意思，今天部门招人，上下午都在面试，晚了，大家海涵。<br><br><br>先说两句前...   True  \n",
       "52  \"以前社交网络不发达，有很多事不明白为什么。<br><br>拿上个牛市，07年说吧。<br>...   True  \n",
       "53  \"散户，你过来，咱们聊聊你应有的投资原则。<br><br>没错，别看别人，说的就是你！<br...   True  \n",
       "54  \"伟大的中国股市正在将牛市继续向前疯狂推进。以上周五收盘价计算，我们计算的沪深两市全部股票（...   True  \n",
       "55  \"我承认，下面这一百只股票里面，可能有5只或者10只会成为伟大企业。但你100多只都这个估值...   True  \n",
       "56  \"写在前面：<br><br>先说几句废话吧，毕竟有些东西一定有人问，评论里一一回复不现实。不...   True  \n",
       "57  \"最近，A股是不是一个“吃人不吐骨头”的市场似乎在雪球引起了不小的争议。在这个市场上，只有1...   True  \n",
       "58  \"看图说话：<br/><br/>1、全市场pe与深综指对比图：全市场pe已经越过2010年高...   True  \n",
       "59  \"闲话不多说，进入正题：<br><br><strong>壹：现在的市场估值<br><br><...   True  \n",
       "60  \"从大的方面来讲，资产配置的重点，就是把资产合理配置到相关系数很低的各项资产中。相关系数低，...   True  \n",
       "61  \"本杰明格雷厄姆在上世纪60年代出版的，针对业余投资者的圣经（针对专业投资者的圣经则是《证券...   True  \n",
       "62  \"今天，看着不断暴跌的中小板，没有等到15:40 wind上的数据计算结束，我就知道，这是伟...   True  \n",
       "\n",
       "[63 rows x 5 columns]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df=read_xueqiu_data(user_id)\n",
    "# df['sended']=True\n",
    "# save_weixin_data(query,df)\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4-final"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}